function getSearch(){
	$(".gridSearch").click(function(){
		var v=$(this).parent().find(".autoComplete").val();
		alert(v);
	});
}

function getTree(){
	$("#mytree").tree({
		url:"json/test.json",
		animate:true,
		onDblClick:function(node){
			$(this).tree("toggle",node.target);
		},
		onClick:function(node){
			if(node.id==113){
				act(2);
			}else if(node.id==112){
				act(1);
			}else if(node.id==111){
				act(0);
			}
		}
	
	});
}
function act(n){
	$("#tabs").tabs("option","active",n);
}
function indexGrid(){
	$('#mygrid').datagrid({
		url:"/yh_vote/subject/selectAllAction" ,
		rownumbers:true,
		iconCls: 'icon-search',
		pagination:true,//显示底部分页栏
		pageSize:6,//默认每页记录数，pagination参数为true时才有效
		pageList:[4,6,8], //显示列表记录数的下拉框选项，pagination参数为true时才有效
		fitColumns:true,//自适应宽度，防止水平滚动
		striped:true,//隔行变色
		columns:[[
          	{field:'id',title:'id',hidden:'true'},
			{field:'title',title:'投票标题',width:300},
			{field:'options',title:'选项数',align:'right'},
			{field:'participants',title:'投票人数',align:'right'},
			{field:'opr',title:'操作',align:'center',formatter:function(){
				return "<a herf='#' style='color:red;'>参加投票</a>";
			}}
		]],
		onClickCell:function(index,field,v){
			if(field=="opr"){
				var id = $(this).datagrid("getRows")[index].id;
				window.location.href="/yh_vote/subject/voteAction?subject.vsId="+id;
			}
		}
	});
}

function manageGrid(){
	$('#manageGrid').datagrid({
		url:'/yh_vote/subject/selectAllAction',
		//singleSelect:true,
		rownumbers:true,
		iconCls: 'icon-search',
		pagination:true,//显示底部分页栏
		pageSize:6,//默认每页记录数，pagination参数为true时才有效
		pageList:[6,10], //显示列表记录数的下拉框选项，pagination参数为true时才有效
		fitColumns:true,//自适应宽度，防止水平滚动
		striped:true,//隔行变色
		queryParams: {
			addr: 'manageGrid'
		},
		columns:[[
			{field:'ck',checkbox:true},
			{field:'id',title:'id',hidden:'true'},
			{field:'title',title:'投票标题',width:300},
			{field:'options',title:'选项数',align:'right'},
			{field:'participants',title:'投票人数',align:'right'},
			{field:'update',title:'操作',align:'center',formatter:function(){
				return "<a herf='#' style='color:red;'>维护</a>";
			}}
		]],
		onClickCell:function(index,field,v){
			if(field=="update"){
				var id = $(this).datagrid("getRows")[index].id;
				window.location.href="/yh_vote/subject/readAction?subject.vsId="+id;
			}
		},
		loadMsg:"正努力为您加载中......"
	});
}